package com.ctsi.ssdc.admin.repository;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import com.ctsi.ssdc.admin.domain.CscpLogOperation;
import com.ctsi.ssdc.admin.domain.CscpLogOperationExample;
import com.ctsi.ssdc.database.annotation.InjectByDataBaseType;
import com.ctsi.ssdc.database.enums.EnumDatabaseName;

/**
 * @author MyBatis Generator
*/
@InjectByDataBaseType(includes= {EnumDatabaseName.ORACLE})
public interface CscpLogOperationRepository {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @SelectProvider(type=CscpLogOperationSqlProvider.class, method="countByExample")
    long countByExample(CscpLogOperationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @DeleteProvider(type=CscpLogOperationSqlProvider.class, method="deleteByExample")
    int deleteByExample(CscpLogOperationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @Delete({
        "delete from cscp_log_operation",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @Insert({
        "insert into cscp_log_operation (userid, username, ",
        "uri, ip, params, ",
        "method, message, ",
        "status, time, error)",
        "values (#{userid,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, ",
        "#{uri,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{params,jdbcType=VARCHAR}, ",
        "#{method,jdbcType=VARCHAR}, #{message,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=CHAR}, #{time,jdbcType=TIMESTAMP}, #{error,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true, keyProperty="id")
    int insert(CscpLogOperation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @InsertProvider(type=CscpLogOperationSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true, keyProperty="id")
    int insertSelective(CscpLogOperation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @SelectProvider(type=CscpLogOperationSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="userid", property="userid", jdbcType=JdbcType.INTEGER),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="uri", property="uri", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="params", property="params", jdbcType=JdbcType.VARCHAR),
        @Result(column="method", property="method", jdbcType=JdbcType.VARCHAR),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.CHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="error", property="error", jdbcType=JdbcType.VARCHAR)
    })
    List<CscpLogOperation> selectByExample(CscpLogOperationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @Select({
        "select",
        "id, userid, username, uri, ip, params, method, message, status, time, error",
        "from cscp_log_operation",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="userid", property="userid", jdbcType=JdbcType.INTEGER),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="uri", property="uri", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="params", property="params", jdbcType=JdbcType.VARCHAR),
        @Result(column="method", property="method", jdbcType=JdbcType.VARCHAR),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.CHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="error", property="error", jdbcType=JdbcType.VARCHAR)
    })
    CscpLogOperation selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @UpdateProvider(type=CscpLogOperationSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") CscpLogOperation record, @Param("example") CscpLogOperationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @UpdateProvider(type=CscpLogOperationSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") CscpLogOperation record, @Param("example") CscpLogOperationExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @UpdateProvider(type=CscpLogOperationSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(CscpLogOperation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @Update({
        "update cscp_log_operation",
        "set userid = #{userid,jdbcType=INTEGER},",
          "username = #{username,jdbcType=VARCHAR},",
          "uri = #{uri,jdbcType=VARCHAR},",
          "ip = #{ip,jdbcType=VARCHAR},",
          "params = #{params,jdbcType=VARCHAR},",
          "method = #{method,jdbcType=VARCHAR},",
          "message = #{message,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=CHAR},",
          "time = #{time,jdbcType=TIMESTAMP},",
          "error = #{error,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CscpLogOperation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_log_operation
     *
     * @mbg.generated Thu Aug 02 11:13:47 CST 2018
     */
    @SelectProvider(type=CscpLogOperationSqlProvider.class, method="selectByExampleWithPage")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="userid", property="userid", jdbcType=JdbcType.INTEGER),
        @Result(column="username", property="username", jdbcType=JdbcType.VARCHAR),
        @Result(column="uri", property="uri", jdbcType=JdbcType.VARCHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="params", property="params", jdbcType=JdbcType.VARCHAR),
        @Result(column="method", property="method", jdbcType=JdbcType.VARCHAR),
        @Result(column="message", property="message", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.CHAR),
        @Result(column="time", property="time", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="error", property="error", jdbcType=JdbcType.VARCHAR)
    })
    List<CscpLogOperation> selectByExamplewithPage(CscpLogOperationExample example);
}